package com.tulasa.corejava.example1;

public class SimpleStrings {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		String simpleString = "SimpleString";
		StringBuilder builder = new StringBuilder();
		builder.append("charAt 0 : " + simpleString.charAt(0));
		builder.append("\nconcat with AndAnotherString : " + simpleString.concat("AndAnotherString"));
		builder.append("\nindexOf 'S' : " + simpleString.indexOf('S'));
		builder.append("\nlastIndexOf 'S' : " + simpleString.lastIndexOf('S'));
		builder.append("\nindexOf 'String' : " + simpleString.indexOf("String"));
		builder.append("\nlastIndexOf 'String' : " + simpleString.lastIndexOf("String"));
		builder.append("\nlength of " + simpleString + " : " + simpleString.length());
		builder.append("\nreplace D with S : " + simpleString.replace('S', 'D'));
		builder.append("\nsubstring from 0 : " + simpleString.substring(0));
		builder.append("\nsubstring between 0 and 5 : " + simpleString.substring(0, 5));
		builder.append("\ntoLowerCase  : " + simpleString.toLowerCase());
		builder.append("\ntoUpperCase  : " + simpleString.toUpperCase());
		builder.append("\nvalueOf  : " + String.valueOf(1000));
		builder.append("\nis endsWith String  : " + simpleString.endsWith("String"));
		builder.append("\nisEmpty  : " + simpleString.isEmpty());
		
		System.out.println(builder.toString());
		
	}

}
